package com.kuang.dao.user;

import com.kuang.pojo.User;
import com.kuang.pojo.Role;



import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;


public interface  UserDao {
//    得到登录用户
    public User getLoginUser(String userCode, Connection connection) throws SQLException;
//    修改密码
    public int updatePwd(Connection connection, int id, String password) throws SQLException;
//    根据用户名或者角色 查询用户总数
    public int getUserCount(Connection connection, String username, int userRole) throws SQLException  ;

//    查询所有用户列表显示
    List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo, int pageSize) throws Exception;

//    添加用户的方法
    int add(Connection connection,User user) throws SQLException;


    /**
     * @description: 得到登录的用户的接口
     * @date 20/12/1 19:49
     * @Param: [connection, userCode]
     * @Return:com.threepure.pojo.User
     */
    User getLoginUser(Connection connection, String userCode) throws SQLException;

    /**
     * @description: 修改用户信息
     * @date 20/12/7 17:27
     * @Param: [connection, user]
     * @Return: int
     */
    public int userModify(Connection connection, User user) throws Exception;

    /**
     * @description: 通过id获取user
     * @date 20/12/7 17:23
     * @Param: [connection, id]
     * @Return: com.threepure.pojo.User
     */
    public User getUserById(Connection connection, String id) throws Exception;

//    刪除
    int deleteUserById(Connection connection,Integer id) throws Exception;


}
